package com.xm;

public class VarType_StaticVar {
    private static int count = 0;

    public VarType_StaticVar() {
        count++;
        // counter = counter + 1;
    }

    public static int getCount() {
        return count;
    }

    public static int test() {
        return new VarType_StaticVar().getCount();
    }




    public static void main(String[] args) {
        VarType_StaticVar varTypeStaticVar = new VarType_StaticVar();
        VarType_StaticVar varTypeStaticVar2 = new VarType_StaticVar();
        VarType_StaticVar varTypeStaticVar3 = new VarType_StaticVar();
        System.out.println("目前为止创建的对象数：" +getCount());
        System.out.println("test：" + test());
    }
}
